package com.itcast.mallapplet.mapper;

import com.itcast.admin.dto.UserDTO;
import com.itcast.admin.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    //根据openid来查询用户
    @Select("select * from user where openid = #{openid}")
    User getUserById(String openid);

    //插入数据并返回主键id
    void insert(User user);

    //查询全部用户信息
    @Select("select * from user")
    List<User> userQueryAll();

    //修改用户
    void amendUser(UserDTO userDTO);

    //查找当前用户信息
    @Select("select * from user where id = #{id}")
    User getByUserId(Long Id);
}
